package com.jianyun.jyzs.utils;

import android.util.Log;

/**
 * Created by yangshijun on 2018/8/15.
 */

public class RceLog {
    private static boolean DEBUG = true;

    public RceLog() {
    }

    public static void setDebug(boolean enable) {
        DEBUG = enable;
    }

    public static void i(String tag, String msg) {
        log(tag, msg, 'i');
    }

    public static void w(String tag, String msg) {
        log(tag, msg, 'w');
    }

    public static void d(String tag, String msg) {
        log(tag, msg, 'd');
    }

    public static void e(String tag, String msg) {
        log(tag, msg, 'e');
    }

    private static void log(String tag, String msg, char level) {
        tag = "RceLog [" + tag + "]";
        if(DEBUG) {
            if(101 == level) {
                Log.e(tag, msg);
            } else if(119 == level) {
                Log.w(tag, msg);
            } else if(100 == level) {
                Log.d(tag, msg);
            } else if(105 == level) {
                Log.i(tag, msg);
            } else {
                Log.v(tag, msg);
            }

           // Log.fd(tag, msg);
        }

    }
}
